package com.lemeng.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.lemeng.entity.PageResult;
import com.lemeng.entity.Result;
import com.lemeng.pojo.Brand;
import com.lemeng.service.AdService;
import com.lemeng.service.BrandService;
import com.lemeng.service.CategoryService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@Controller
public class IndexController {
   @Reference
    AdService adService;

   @Reference
   CategoryService categoryService;

    @GetMapping("index")
    public String index(Model model){
        //model.addAttribute("adList",adService.findByPosition("web_index_lb"));
        model.addAttribute("adList",adService.findByPosition("web_index_lb"));
        model.addAttribute("categoryList",categoryService.findCategoryMenus());
        return "index";
    }



}
